var app = getApp();
Page({
  onLoad: function (options) {
    wx.getSetting({
      success: function (res) {
        if (res.authSetting['scope.userInfo']) {
          //用户已经授权过从缓存中拿userinfo、openid、userid
          app.globalData.userInfo = wx.getStorageSync('userInfo')
          app.globalData.openId = wx.getStorageSync('openId')
          app.globalData.userId = wx.getStorageSync('userId')
          wx.reLaunch({
            url: '../home/home'
          })
        }
      }
    })
  },
  bindGetUserInfo: function (e) {
    app.getUserInfo();
  }
})